package gugga.tasks
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	import gugga.tasks.events.ProgressiveTaskEvent;
	import gugga.eventHelpers.EventRethrower;
	
	[Event(name="start", type="TaskEvent")]
	[Event(name="interrupted", type="TaskEvent")]
	[Event(name="completed", type="TaskEvent")]
	[Event(name="progress", type="ProgressiveTaskEvent")]
	
	/**
	 * <code>MonitoringProgressiveTask</code> monitors the progress of an 
	 * <code>IProgressiveTask</code>.
	 * 
	 * @see gugga.tasks.MonitoringTask
	 */ 
	public class MonitoringProgressiveTask extends MonitoringTask implements ITask
	{
		public function MonitoringProgressiveTask(aMonitoredTask : IProgressiveTask)
		{
			super(aMonitoredTask);
			EventRethrower.create(this, mMonitoredTask, ProgressiveTaskEvent.PROGRESS);		
		}
		
		public function getProgress() : Number 
		{
			return IProgressiveTask(mMonitoredTask).getProgress();
		}
	}
}